package com.leejxx.apis.wemedia;

import com.leejxx.model.common.dto.ResponseResult;
import com.leejxx.model.wemedia.pojos.WmNews;
import com.leejxx.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author LeeJx
 * @ClassName IWemediaClient
 * @Description TODO
 * @date 2021/2/20 10:02
 * @Version 1.0
 */
@FeignClient("leadnews-wemedia")
public interface IWemediaClient {
    @PostMapping("/api/v1/user/save")
    ResponseResult save(@RequestBody WmUser wmUser) ;

    @GetMapping("/api/v1/user/findByName/{name}")
    WmUser findByName(@PathVariable("name") String name);

    @GetMapping("/api/v1/news/findOne/{id}")
    WmNews findNewsById(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/news/update")
    ResponseResult updateWmNews(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/user/findOne/{id}")
    WmUser findWmUserById(@PathVariable("id") Long id);

    @GetMapping("/api/v1/news/findRelease")
    List<Integer> findRelease();
}
